From d74c2a74e52f30cb2d5dd99cd781289fa9702be2 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 1 Nov 2020 11:14:24 -0500 Subject: [PATCH] builder-tool: Drop unneeded code We are rewriting the tree before simplifying it, so there is no need to 'keep things for rewriting' in the simplify phase. --- gtk/tools/gtk-builder-tool-simplify.c | 57 --------------------------- 1 file changed, 57 deletions(-) diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c index ec4e8d5129..726c21f649 100644 --- a/gtk/tools/gtk-builder-tool-simplify.c +++ b/gtk/tools/gtk-builder-tool-simplify.c @@ -211,59 +211,6 @@ needs_explicit_setting (GParamSpec *pspec, return found; } -static gboolean -keep_for_rewrite (const char *class_name, - const char *property_name, - PropKind kind) -{ - struct _Prop { - const char *class; - const char *property; - PropKind kind; - } props[] = { - { "GtkPopover", "modal", PROP_KIND_OBJECT }, - { "GtkActionBar", "pack-type", PROP_KIND_PACKING }, - { "GtkHeaderBar", "pack-type", PROP_KIND_PACKING }, - { "GtkPopoverMenu", "submenu", PROP_KIND_PACKING }, - { "GtkToolbar", "expand", PROP_KIND_PACKING }, - { "GtkToolbar", "homogeneous", PROP_KIND_PACKING }, - { "GtkPaned", "resize", PROP_KIND_PACKING }, - { "GtkPaned", "shrink", PROP_KIND_PACKING }, - { "GtkOverlay", "measure", PROP_KIND_PACKING }, - { "GtkOverlay", "clip-overlay", PROP_KIND_PACKING }, - { "GtkGrid", "column", PROP_KIND_PACKING }, - { "GtkGrid", "row", PROP_KIND_PACKING }, - { "GtkGrid", "width", PROP_KIND_PACKING }, - { "GtkGrid", "height", PROP_KIND_PACKING }, - { "GtkStack", "name", PROP_KIND_PACKING }, - { "GtkStack", "title", PROP_KIND_PACKING }, - { "GtkStack", "icon-name", PROP_KIND_PACKING }, - { "GtkStack", "needs-attention", PROP_KIND_PACKING }, - }; - gboolean found; - int k; - char *canonical_name; - - canonical_name = g_strdup (property_name); - g_strdelimit (canonical_name, "_", '-'); - - found = FALSE; - for (k = 0; k < G_N_ELEMENTS (props); k++) - { - if (strcmp (class_name, props[k].class) == 0 && - strcmp (canonical_name, props[k].property) == 0 && - kind == props[k].kind) - { - found = TRUE; - break; - } - } - - g_free (canonical_name); - - return found; -} - static gboolean has_attribute (Element *elt, const char *name, @@ -657,10 +604,6 @@ property_can_be_omitted (Element *element, property_name = (const char *)element->attribute_values[i]; } - if (data->convert3to4 && - keep_for_rewrite (class_name, property_name, kind)) - return FALSE; /* keep, will be rewritten */ - if (translatable) return FALSE; -- 2.30.2